<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222"><meta name="generator" content="Hexo 6.2.0">


  <link rel="apple-touch-icon" sizes="180x180" href="https://www.wulihub.com.cn/gc/Wez0VG/images/apple-touch-icon.png">
  <link rel="icon" type="image/png" sizes="32x32" href="https://www.wulihub.com.cn/gc/Wez0VG/images/favicon-32x32.png">
  <link rel="icon" type="image/png" sizes="16x16" href="https://www.wulihub.com.cn/gc/Wez0VG/images/favicon-16x16.png">
  <link rel="mask-icon" href="https://www.wulihub.com.cn/gc/Wez0VG/images/logo.svg" color="#222">

<link rel="stylesheet" href="https://www.wulihub.com.cn/gc/Wez0VG/css/main.css">



<link rel="stylesheet" href="https://npm.elemecdn.com/@fortawesome/fontawesome-free@6.1.1/css/all.min.css" integrity="sha256-DfWjNxDkM94fVBWx1H5BMMp0Zq7luBlV8QRcSES7s+0=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://npm.elemecdn.com/animate.css@3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">

<script class="next-config" data-name="main" type="application/json">{"hostname":"nobige.cn","root":"/","images":"https://www.wulihub.com.cn/gc/Wez0VG/images","scheme":"Gemini","darkmode":false,"version":"8.12.2","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":{"enable":false,"style":null},"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"Searching...","empty":"We didn't find any results for the search: ${query}","hits_time":"${hits} results found in ${time} ms","hits":"${hits} results found"},"path":"/search.xml","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false}}</script><script src="https://www.wulihub.com.cn/gc/Wez0VG/js/config.js"></script>

    <meta name="description" content="Photo by Al Soot on Unsplash 接口https:&#x2F;&#x2F;www.bing.com&#x2F;HPImageArchive.aspx?format&#x3D;js&amp;n&#x3D;1&amp;idx&#x3D;0&amp;mkt&#x3D;em-Us&amp;toHttps&#x3D;1  format - 返回格式,可选 默认xml [xml,js] n - 显示历史条数,必须 范围[1-8] idx - 图片日期 -1为今天">
<meta property="og:type" content="article">
<meta property="og:title" content="api 机智的必应程序员bing每日壁纸">
<meta property="og:url" content="https://nobige.cn/post/20171020-Cleverbingtheprogrammer/index.html">
<meta property="og:site_name" content="NoBige-JackCh3n">
<meta property="og:description" content="Photo by Al Soot on Unsplash 接口https:&#x2F;&#x2F;www.bing.com&#x2F;HPImageArchive.aspx?format&#x3D;js&amp;n&#x3D;1&amp;idx&#x3D;0&amp;mkt&#x3D;em-Us&amp;toHttps&#x3D;1  format - 返回格式,可选 默认xml [xml,js] n - 显示历史条数,必须 范围[1-8] idx - 图片日期 -1为今天">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20171020-Cleverbingtheprogrammer/al-soot-q9-rkEJfIG4-unsplash.jpg">
<meta property="og:image" content="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20171020-Cleverbingtheprogrammer/xiao2018-10-13_14-58-33.jpg">
<meta property="og:image" content="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20171020-Cleverbingtheprogrammer/xiao20171020224342.png">
<meta property="og:image" content="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20171020-Cleverbingtheprogrammer/xiao20171020224632.png">
<meta property="og:image" content="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20171020-Cleverbingtheprogrammer/xiao20171020225707.png">
<meta property="og:image" content="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20171020-Cleverbingtheprogrammer/xiao20171020225831.png">
<meta property="og:image" content="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20171020-Cleverbingtheprogrammer/xiao20171020234645.png">
<meta property="article:published_time" content="2017-10-20T14:38:51.000Z">
<meta property="article:modified_time" content="2024-11-07T02:59:06.170Z">
<meta property="article:author" content="JackCh3n">
<meta property="article:tag" content="api">
<meta property="article:tag" content="bing">
<meta property="article:tag" content="壁纸">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20171020-Cleverbingtheprogrammer/al-soot-q9-rkEJfIG4-unsplash.jpg">


<link rel="canonical" href="https://nobige.cn/post/20171020-Cleverbingtheprogrammer/">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"en","comments":true,"permalink":"https://nobige.cn/post/20171020-Cleverbingtheprogrammer/","path":"post/20171020-Cleverbingtheprogrammer/","title":"api 机智的必应程序员bing每日壁纸"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>api 机智的必应程序员bing每日壁纸 | NoBige-JackCh3n</title>
  
  <script class="next-config" data-name="google_analytics" type="application/json">{"tracking_id":"UA-122817633-1","only_pageview":true}</script>
  <script src="https://www.wulihub.com.cn/gc/Wez0VG/js/third-party/analytics/google-analytics.js"></script>

  <script src="https://www.wulihub.com.cn/gc/Wez0VG/js/third-party/analytics/baidu-analytics.js"></script>
  <script async src="https://hm.baidu.com/hm.js?96741f92c07d010c0ddd1d02197893e2"></script>




  <noscript>
    <link rel="stylesheet" href="https://www.wulihub.com.cn/gc/Wez0VG/css/noscript.css">
  </noscript>
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="Toggle navigation bar" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <p class="site-title">NoBige-JackCh3n</p>
      <i class="logo-line"></i>
    </a>
      <p class="site-subtitle" itemprop="description">copy to my blog</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="home fa-fw"></i>Home</a></li><li class="menu-item menu-item-about"><a href="/about/" rel="section"><i class="user fa-fw"></i>About</a></li><li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="tags fa-fw"></i>Tags</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="th fa-fw"></i>Categories</a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="archive fa-fw"></i>Archives</a></li><li class="menu-item menu-item-sitemap"><a href="/sitemap.xml" rel="section"><i class="sitemap fa-fw"></i>Sitemap</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>Search
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup"><div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off" maxlength="80"
           placeholder="Searching..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close" role="button">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div class="search-result-container no-result">
  <div class="search-result-icon">
    <i class="fa fa-spinner fa-pulse fa-5x"></i>
  </div>
</div>

    </div>
  </div>

</div>
        
  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>

  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          Table of Contents
        </li>
        <li class="sidebar-nav-overview">
          Overview
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E6%8E%A5%E5%8F%A3"><span class="nav-number">1.</span> <span class="nav-text">接口</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E6%BA%90%E7%A0%81"><span class="nav-number">2.</span> <span class="nav-text">源码</span></a></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="JackCh3n"
      src="https://www.wulihub.com.cn/gc/Wez0VG/images/avatar.png">
  <p class="site-author-name" itemprop="name">JackCh3n</p>
  <div class="site-description" itemprop="description">Record the pit filling process with words</div>
</div>
<div class="site-state-wrap site-overview-item animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">146</span>
          <span class="site-state-item-name">posts</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">42</span>
        <span class="site-state-item-name">categories</span></a>
      </div>
      <div class="site-state-item site-state-tags">
          <a href="/tags/">
        <span class="site-state-item-count">279</span>
        <span class="site-state-item-name">tags</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author site-overview-item animated">
      <span class="links-of-author-item">
        <a href="https://github.com/jackch3n" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;jackch3n" rel="noopener" target="_blank"><i class="github fa-fw"></i>GitHub</a>
      </span>
  </div>


  <div class="links-of-blogroll site-overview-item animated">
    <div class="links-of-blogroll-title"><i class="fa fa-globe fa-fw"></i>
      Links
    </div>
    <ul class="links-of-blogroll-list">
        <li class="links-of-blogroll-item">
          <a href="https://vercel.com/?f=nobige" title="https:&#x2F;&#x2F;vercel.com?f&#x3D;nobige" rel="noopener" target="_blank">vercel</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://www.jsdelivr.com/?f=nobige" title="https:&#x2F;&#x2F;www.jsdelivr.com?f&#x3D;nobige" rel="noopener" target="_blank">jsdelivr</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://www.upyun.com/?f=nobige" title="https:&#x2F;&#x2F;www.upyun.com?f&#x3D;nobige" rel="noopener" target="_blank">upyun</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://coding.net/?f=nobige" title="https:&#x2F;&#x2F;coding.net?f&#x3D;nobige" rel="noopener" target="_blank">coding</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://unsplash.com/?f=nobige" title="https:&#x2F;&#x2F;unsplash.com?f&#x3D;nobige" rel="noopener" target="_blank">unsplash</a>
        </li>
    </ul>
  </div>

        </div>
      </div>
    </div>
  </aside>
  <div class="sidebar-dimmer"></div>


    </header>

    
  <div class="back-to-top" role="button" aria-label="Back to top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="en">
    <link itemprop="mainEntityOfPage" href="https://nobige.cn/post/20171020-Cleverbingtheprogrammer/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="https://www.wulihub.com.cn/gc/Wez0VG/images/avatar.png">
      <meta itemprop="name" content="JackCh3n">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="NoBige-JackCh3n">
      <meta itemprop="description" content="Record the pit filling process with words">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="api 机智的必应程序员bing每日壁纸 | NoBige-JackCh3n">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          api 机智的必应程序员bing每日壁纸
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">Posted on</span>

      <time title="Created: 2017-10-20 22:38:51" itemprop="dateCreated datePublished" datetime="2017-10-20T22:38:51+08:00">2017-10-20</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">Edited on</span>
      <time title="Modified: 2024-11-07 10:59:06" itemprop="dateModified" datetime="2024-11-07T10:59:06+08:00">2024-11-07</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">In</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/api/" itemprop="url" rel="index"><span itemprop="name">api</span></a>
        </span>
    </span>

  
    <span class="post-meta-item" title="Views" id="busuanzi_container_page_pv">
      <span class="post-meta-item-icon">
        <i class="far fa-eye"></i>
      </span>
      <span class="post-meta-item-text">Views: </span>
      <span id="busuanzi_value_page_pv"></span>
    </span>
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
        <p><img src="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20171020-Cleverbingtheprogrammer/al-soot-q9-rkEJfIG4-unsplash.jpg" alt="Aircraft seats"></p>
<p><em>Photo by Al Soot on Unsplash</em></p>
<h2 id="接口"><a href="#接口" class="headerlink" title="接口"></a>接口</h2><p><code>https://www.bing.com/HPImageArchive.aspx?format=js&amp;n=1&amp;idx=0&amp;mkt=em-Us&amp;toHttps=1</code></p>
<ul>
<li>format - 返回格式,<strong>可选</strong> 默认xml [xml,js]</li>
<li>n - 显示历史条数,<strong>必须</strong> 范围[1-8]</li>
<li>idx - 图片日期 -1为今天 0为昨天 1 为前天,<strong>可选</strong> [范围-1 - 8]</li>
<li>mkt - 国家，亲测大部分国家相同，默认为访问者IP的国家，浏览器直接测试无法更改国家，<strong>可选</strong></li>
<li>已成功测试国家有<ul>
<li>zh-CN</li>
<li>ja-JP - 不同于其他</li>
<li>en-NZ - 不同于其他</li>
<li>en-US  - 同中国，时区问题</li>
<li>en-AU - 同中国，时区问题</li>
<li>en-CA - 同中国，时区问题</li>
<li>de-DE - 同中国，时区问题</li>
</ul>
</li>
<li>toHtpps - 强制https 有无均可</li>
</ul>
<h2 id="源码"><a href="#源码" class="headerlink" title="源码"></a>源码</h2><figure class="highlight vb"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br></pre></td><td class="code"><pre><span class="line">.版本 <span class="number">2</span></span><br><span class="line">.支持库 spec</span><br><span class="line">.支持库 internet</span><br><span class="line"></span><br><span class="line">.程序集 程序集<span class="number">1</span></span><br><span class="line"></span><br><span class="line">.子程序 _启动子程序, 整数型, , 本子程序在程序启动后最先执行</span><br><span class="line">.局部变量 data_json, 类_json</span><br><span class="line">.局部变量 data, 字节集</span><br><span class="line">.局部变量 <span class="keyword">text</span>, 文本型</span><br><span class="line">.局部变量 jpg, 文本型</span><br><span class="line">.局部变量 <span class="type">date</span>, 日期时间型</span><br><span class="line">.局部变量 name, 文本型</span><br><span class="line">.局部变量 save_name, 文本型</span><br><span class="line"></span><br><span class="line">调试输出 (文件是否存在 (“D:\wallpaper\”))</span><br><span class="line">.如果 (文件是否存在 (“D:\wallpaper\”) ＝ 假)</span><br><span class="line">    目录_创建 (“D:\wallpaper\”)</span><br><span class="line">.否则</span><br><span class="line"></span><br><span class="line">.如果结束</span><br><span class="line">data ＝ 网页_访问 (“https://cn.bing.com/HPImageArchive.aspx?format=js&amp;idx=-<span class="number">1&amp;</span>n=<span class="number">1</span>”)</span><br><span class="line"><span class="keyword">text</span> ＝ 到文本 (data)</span><br><span class="line">name ＝ 文本_取出中间文本 (<span class="keyword">text</span>, “url#引号:#引号”, “#引号,#引号urlbase”)</span><br><span class="line">save_name ＝ 到文本 (取年份 (取现行时间 ())) ＋ 到文本 (取月份 (取现行时间 ())) ＋ 到文本 (取日 (取现行时间 ())) ＋ 取文本右边 (name, <span class="number">4</span>)</span><br><span class="line">jpg ＝ “https://cn.bing.com” ＋ name</span><br><span class="line">写到文件 (“D:\wallpaper\” ＋ save_name, HTTP读文件 (jpg))</span><br><span class="line">系统_置桌面背景 (“D:\wallpaper\” ＋ save_name)</span><br><span class="line"></span><br><span class="line">返回 (<span class="number">0</span>)  <span class="comment">&#x27; 可以根据您的需要返回任意数值</span></span><br><span class="line"></span><br></pre></td></tr></table></figure>

<p><img src="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20171020-Cleverbingtheprogrammer/xiao2018-10-13_14-58-33.jpg" alt="json"></p>
<p>##1X 故事的缘由</p>
<p>闲着无聊逛发现一个神奇的api 第三方api 觉得还是挺有意思的（第一看到有图片描述,以前有用过必应壁纸软件 自动设置成壁纸）</p>
<p><img src="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20171020-Cleverbingtheprogrammer/xiao20171020224342.png" alt="别人的api"></p>
<p>响应方式：JSON。<br>    - url 为壁纸的url链接<br>    - title 为图片的标题<br>    - d 为图片的描述。</p>
<p><img src="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20171020-Cleverbingtheprogrammer/xiao20171020224632.png" alt="api"></p>
<p>别人的是挺好的 但是第三方永远是第三方 万一他网站哪天GG了或者被打了怎么办？？于是便研究了下bing首页<br>发现其“必应的api” ？ </p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">https://cn.bing.com/HPImageArchive.aspx?format=js&amp;n=1&amp;toHttps=1</span><br><span class="line">formath=js 时 为json格式，去除则xml格式</span><br><span class="line">n=1 为今天 2为今天算起往后推</span><br><span class="line">toHttps=1 估计是强制https 1为真？ </span><br></pre></td></tr></table></figure>
<p>api 假装在分析</p>
<figure class="highlight php"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">&#123;</span><br><span class="line">  <span class="string">&quot;images&quot;</span>: [<span class="comment">//不用我说都知道是我们要的图片</span></span><br><span class="line">    &#123;</span><br><span class="line">      <span class="string">&quot;startdate&quot;</span>: <span class="string">&quot;20171019&quot;</span>,<span class="comment">//开始日期</span></span><br><span class="line">      <span class="string">&quot;fullstartdate&quot;</span>: <span class="string">&quot;201710191600&quot;</span>,</span><br><span class="line">      <span class="string">&quot;enddate&quot;</span>: <span class="string">&quot;20171020&quot;</span>,<span class="comment">//戒指日期</span></span><br><span class="line">      <span class="string">&quot;url&quot;</span>: <span class="string">&quot;/az/hprichbg/rb/LaGrandeNomade_ZH-CN10098798714_1920x1080.jpg&quot;</span>,<span class="comment">//图片地址 加上 https://cn.bing.com</span></span><br><span class="line">      <span class="string">&quot;urlbase&quot;</span>: <span class="string">&quot;/az/hprichbg/rb/LaGrandeNomade_ZH-CN10098798714&quot;</span>,</span><br><span class="line">      <span class="string">&quot;copyright&quot;</span>: <span class="string">&quot;由艺术家荷梅·潘萨设计的流浪者雕像的内部细节，法国昂蒂布 (© travelstock44/Alamy)&quot;</span>,<span class="comment">//版权</span></span><br><span class="line">      <span class="string">&quot;copyrightlink&quot;</span>: <span class="string">&quot;http://www.bing.com/search?q=Le+Nomade&amp;form=hpcapt&amp;mkt=zh-cn&quot;</span>,</span><br><span class="line">      <span class="string">&quot;quiz&quot;</span>: <span class="string">&quot;/search?q=Bing+homepage+quiz&amp;filters=WQOskey:%22HPQuiz_20171019_LaGrandeNomade%22&amp;FORM=HPQUIZ&quot;</span>,</span><br><span class="line">      <span class="string">&quot;wp&quot;</span>: <span class="literal">false</span>,</span><br><span class="line">      <span class="string">&quot;hsh&quot;</span>: <span class="string">&quot;86c4bc7d789fce187c0f349ebd12def5&quot;</span>,<span class="comment">//图片has？</span></span><br><span class="line">      <span class="string">&quot;drk&quot;</span>: <span class="number">1</span>,</span><br><span class="line">      <span class="string">&quot;top&quot;</span>: <span class="number">1</span>,</span><br><span class="line">      <span class="string">&quot;bot&quot;</span>: <span class="number">1</span>,</span><br><span class="line">      <span class="string">&quot;hs&quot;</span>: [</span><br><span class="line">        </span><br><span class="line">      ]</span><br><span class="line">    &#125;</span><br><span class="line">  ],</span><br><span class="line">  <span class="string">&quot;tooltips&quot;</span>: &#123;</span><br><span class="line">    <span class="string">&quot;loading&quot;</span>: <span class="string">&quot;正在加载...&quot;</span>,</span><br><span class="line">    <span class="string">&quot;previous&quot;</span>: <span class="string">&quot;上一个图像&quot;</span>,</span><br><span class="line">    <span class="string">&quot;next&quot;</span>: <span class="string">&quot;下一个图像&quot;</span>,</span><br><span class="line">    <span class="string">&quot;walle&quot;</span>: <span class="string">&quot;此图片不能下载用作壁纸。&quot;</span>,</span><br><span class="line">    <span class="string">&quot;walls&quot;</span>: <span class="string">&quot;下载今日美图。仅限用作桌面壁纸。&quot;</span></span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>一开始还是没有找到图片详情的 只发现一个这个东西没有怎么注意 找了几遍后终于把重心放在这个页面上 </p>
<p><img src="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20171020-Cleverbingtheprogrammer/xiao20171020225707.png" alt="神奇"></p>
<p>Ctrl + A 后出现了真正的面目 不得不说必应的程序员真Tm有才 或者说我见识少？</p>
<p><img src="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20171020-Cleverbingtheprogrammer/xiao20171020225831.png" alt="神奇"></p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">https://cn.bing.com/cnhp/life?toHttps=1</span><br><span class="line">toHttps=1 估计是强制https 1为真？</span><br></pre></td></tr></table></figure>
<p>至于文字需怎么抓取？ 正则？？？ 写的一手烂正则。。。</p>
<figure class="highlight php"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line"><span class="meta">&lt;?php</span></span><br><span class="line"><span class="variable">$str</span>=<span class="string">&#x27;&lt;div class=&quot;hplaTtl&quot;&gt; “思想也可以被触摸” &lt;/div&gt; &lt;div&gt; &lt;span class=&quot;hplaDM&quot;&gt;去看看 &lt;img class=&quot;rms_img&quot; src=&quot;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;hplaAttr&quot;&gt;法国，昂蒂布&lt;/span&gt; &lt;/div&gt; &lt;div class=&quot;hplaCata&quot;&gt; &lt;div class=&quot;hplatt&quot;&gt; 那些创意感十足的雕像 &lt;/div&gt; &lt;div class=&quot;hplats&quot;&gt; 你是否触摸到那些艺术家的脑洞 &lt;/div&gt; &lt;div id=&quot;hplaSnippet&quot;&gt; 雕刻家荷梅&amp;#183;潘萨在世界各地制造了许多大型雕塑。“Le Nomade”描绘了一个由不锈钢制成的人形雕像，它被切割成英文字母。当你在法国的昂蒂布参观时，你会发现这个雕像非常巨大，这也与潘萨的创作理念一致，它创造的艺术不仅吸引了我们的视觉感官，我们的思想也被他带动。 &lt;/div&gt; &lt;div class=&quot;hplaPvd&quot;&gt; 文/时尚旅游 &lt;/div&gt; &lt;/div&gt;&#x27;</span>;</span><br><span class="line"><span class="variable">$preg</span> = <span class="string">&#x27;/&lt;div.(class|id)=&quot;(hplaTtl|hplaSnippet)&quot;&gt;(.*?)&lt;\/div&gt;/&#x27;</span>;</span><br><span class="line"><span class="title function_ invoke__">preg_match_all</span>(<span class="variable">$preg</span>,<span class="variable">$str</span>,<span class="variable">$arr</span>);	</span><br><span class="line"><span class="title function_ invoke__">print_r</span>(<span class="variable">$arr</span>);</span><br></pre></td></tr></table></figure>

<p><img src="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20171020-Cleverbingtheprogrammer/xiao20171020234645.png" alt="运行结果"></p>
<p>嗯 该有的都有了 至此bing 每日图片api就有了</p>

    </div>

    
    
    

    <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/api/" rel="tag"># api</a>
              <a href="/tags/bing/" rel="tag"># bing</a>
              <a href="/tags/%E5%A3%81%E7%BA%B8/" rel="tag"># 壁纸</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/post/20170926-0902jqueryLearn/" rel="prev" title="js  jquery 学习小笔记">
                  <i class="fa fa-chevron-left"></i> js  jquery 学习小笔记
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/post/20171026-clanguagestudynotes/" rel="next" title="C语言学习笔记">
                  C语言学习笔记 <i class="fa fa-chevron-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>






    
  <div class="comments" id="disqus_thread">
    <noscript>Please enable JavaScript to view the comments powered by Disqus.</noscript>
  </div>
  
</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">


<div class="copyright">
  &copy; 
  <span itemprop="copyrightYear">2024</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">JackCh3n</span>
</div>
<div class="busuanzi-count">
    <span class="post-meta-item" id="busuanzi_container_site_uv">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="Total Visitors">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-item" id="busuanzi_container_site_pv">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="Total Views">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>
  <div class="powered-by">Powered by <a href="https://hexo.io/" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/" rel="noopener" target="_blank">NexT.Gemini</a>
  </div>
    <br/>Powerful CDN service provided by 
  <a target="_blank" rel="noopener" href="https://www.upyun.com/?utm_source=lianmeng&utm_medium=referral" style="border:none"><img src="https://www.wulihub.com.cn/gc/Wez0VG/images/upyun_logo.png" height="66" style="display: list-item;" alt="upyun"></a> 
  <a target="_blank" rel="noopener" href="https://www.jsdelivr.com" style="border:none"><img src="https://www.wulihub.com.cn/gc/Wez0VG/images/jsdelivr_logo.svg" height="50" style="display: list-item;" alt="JsDelivr"></a>
  <p>
  <br/><a target="_blank" rel="noopener" href="https://pages.github.com/?f=nobige">Github Pages</a>&nbsp;&nbsp;<a target="_blank" rel="noopener" href="https://vercel.com/?f=nobige">Vercel</a>&nbsp;&nbsp;<a target="_blank" rel="noopener" href="https://www.netlify.com/?f=nobige">Netlify</a>&nbsp;&nbsp;<a target="_blank" rel="noopener" href="https://coding.net/?f=nobige">coding</a>&nbsp;&nbsp;provides static publishing
  </p>

    </div>
  </footer>

  
  <script src="https://npm.elemecdn.com/animejs@3.2.1/lib/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
<script src="https://www.wulihub.com.cn/gc/Wez0VG/js/comments.js"></script><script src="https://www.wulihub.com.cn/gc/Wez0VG/js/utils.js"></script><script src="https://www.wulihub.com.cn/gc/Wez0VG/js/motion.js"></script><script src="https://www.wulihub.com.cn/gc/Wez0VG/js/next-boot.js"></script>

  
<script src="https://npm.elemecdn.com/hexo-generator-searchdb@1.4.0/dist/search.js" integrity="sha256-vXZMYLEqsROAXkEw93GGIvaB2ab+QW6w3+1ahD9nXXA=" crossorigin="anonymous"></script>
<script src="https://www.wulihub.com.cn/gc/Wez0VG/js/third-party/search/local-search.js"></script>





  
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>




<link rel="stylesheet" href="https://npm.elemecdn.com/disqusjs@1.3.0/dist/disqusjs.css" integrity="sha256-GxdCIOyfxQ1OBfS99qAIJDoGK1ADuBsxhMTqXG82fAY=" crossorigin="anonymous">

<script class="next-config" data-name="disqusjs" type="application/json">{"enable":true,"api":"https://duosuo.nobige.cn/","apikey":"Kmo9kPwsir7ppp8tGpeGROCmUtW8tdZBOdBVowPC67xVfTS5uV1wr6s4kckvP95m","shortname":"nobige","js":{"url":"https://npm.elemecdn.com/disqusjs@1.3.0/dist/disqus.js","integrity":"sha256-LVaMHPQ2zLqOc5rXSAfr4d1PIkEGNLyyUTDNPZmTtUw="}}</script>
<script src="https://www.wulihub.com.cn/gc/Wez0VG/js/third-party/comments/disqusjs.js"></script>

</body>
</html>
